<?php
namespace app\datastruct\controller;
use think\Controller;
class Tests extends Controller
{
    public $singlelinklist = null;
    public function _initialize()
    {
        parent::_initialize();
        $this->singlelinklist = new SingleLinkList();
    }

    public function look()
    {
        $this->singlelinklist->addlast('a');
        $this->singlelinklist->addlast('b');
        $this->singlelinklist->addlast('c');
        $this->singlelinklist->addlast('d');
        $this->singlelinklist->addlast('e');
        $this->singlelinklist->addlast('f');
        $this->singlelinklist->addlast('g');
        var_dump($this->singlelinklist->insert(1, "hello"));
        var_dump($this->singlelinklist->del(2));
        var_dump($this->singlelinklist->update(2, 'world'));
        $this->singlelinklist->show();
        var_dump($this->singlelinklist->head);

    }
}